$(function () {
    vm.loadDish();
});
var vm = new Vue({
    el: '#rrapp',
    data: {
        score : {
            dishId : 0,
            raterTable : 0,
            taste : 0,
            exterior : 0,
            originality : 0
        },
        dishes: [],
        msg : '',
        dishName : '',
    },
    methods: {
        commitScore : function () {
            $.ajax({
                url : "../score",
                type : 'POST',
                contentType:"application/json;charset=UTF-8",
                data : JSON.stringify(vm.score),
                success : function (result) {
                    vm.msg = result.msg;
                    alert(result.msg);
                }
            })
        },
        loadDish : function () {
            $.ajax({
                url : "../loadDish?t=" + $.now(),
                type : 'get',
                success : function (result) {
                    vm.dishes = result.dishes;
                }
            })
        }
    }
});